using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableFieldResourcePosDao:DaoBase<TableFieldResourcePos>
    {
        public override void AddPrimaryIndex(TableFieldResourcePos model)
        {
            cachePrimary[model.posId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableFieldResourcePos.txt";
        }

        protected override TableFieldResourcePos ParseRowData(string[] rowData)
        {
            TableFieldResourcePos data = new TableFieldResourcePos();
			data.posId = rowData [0];

            if (string.IsNullOrEmpty(rowData[1]))
            {
                data.r = 0;
            }
            else
            {
                data.r = double.Parse(rowData[1]);
            }

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.angle = 0;
            }
            else
            {
                data.angle = double.Parse(rowData[2]);
            }
			data.pos = rowData [3];
			data.resourceIdProbs = rowData [4];

            return data;
        }



    }

}
